package com.shiro.demo.service.impl;

import com.shiro.demo.domain.Permission;
import com.shiro.demo.domain.Role;
import com.shiro.demo.mapper.PermissionMapper;
import com.shiro.demo.mapper.RoleMapper;
import com.shiro.demo.mapper.RolePermissionMapper;
import com.shiro.demo.service.UserRolePermissionService;
import com.shiro.demo.vo.RolePermissionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

@Service
public class UserRolePermissionServiceImpl implements UserRolePermissionService {
    @Autowired
    private RoleMapper roleMapper;
    @Autowired
    private PermissionMapper permissionMapper;
    @Autowired
    private RolePermissionMapper rolePermissionMapper;


    @Override
    public List<Role> roleListByUserId(Long userId) {
        return this.roleMapper.roleListByUserId(userId);
    }

    @Override
    public List<Permission> permissionListByRoleIds(Set<Long> roleIds) {
        return this.permissionMapper.permissionListByRoleIds(roleIds);
    }

    @Override
    public List<RolePermissionVO> rolePermissionList() {
        return this.rolePermissionMapper.rolePermissionList();
    }

    @Override
    public List<Permission> permissionList() {
        return this.permissionMapper.permissionList();
    }


}
